package com.mubolg.controller.manager;

import com.mubolg.pojo.param.RegisterSaveLoginParam;
import com.mubolg.service.ILoginService;
import com.mubolg.pojo.domain.Login;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.validation.Valid;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mubolg.pojo.query.PageQueryWrapper;
import com.mubolg.result.R;
import com.mubolg.result.PageResult;

import java.util.List;

@Tag(name = "登录表",description = "登录表")
@RestController
@RequestMapping("/manager/login")
public class LoginController{

    @Autowired
    public ILoginService loginService;

    @Operation( summary= "保存Login",description = "基础对象保存接口")
    @Parameter(name = "login",description = "保存的对象",required = true)
    @PostMapping
    public R<Void> save(@RequestBody @Valid RegisterSaveLoginParam registerSaveLoginParam){
        loginService.registerSaveLogin(registerSaveLoginParam);
        return R.success();
    }


    @Operation( summary= "登录接口",description = "微信登录接口")
    @Parameter(name = "login",description = "微信登录接口",required = true)
    @PostMapping("/wxlogin/{code}/{type}")
    public R<Void> save(@PathVariable("code") String code , @PathVariable("type") Integer type){
        loginService.wxlogin(code,type);
        return R.success();
    }


}
